package com.wanxi.exception;

import java.util.Scanner;

public class StudentPrint {
    public static void main(String[] args) {

//        while (true) {
//            Scanner scanner = new Scanner(System.in);
//            System.out.println("请输入年龄");
//            int age = 0;
//            try {
//                age = scanner.nextInt();
//                System.out.println("你输入的年龄为:" + age);
//            } catch (Exception e) {
//                System.out.println("你输入的年龄为错误，请重新输入");
//            }
//            if (age == 100) {
//                break;
//            }
//        }
        int bb = getAge();
//        System.out.println(bb);
    }

    private static int a = 0;

    public static int getAge() {
        try {
//            System.out.println("221");
            return aa();
        } catch (Exception e) {

        } finally {
            a = 1;
            System.out.println(a + "----");
            return a;
        }
    }

    public static int aa() {
        a = 2;
        System.out.println(a);
        return a;
    }
}
